how to convert dictionary to tensor in tensorflow